package cn.itcast.java.stream;

import java.io.*;

/**
 * Author itcast
 * Date 2021/10/13 6:00
 * Desc TODO
 */
public class FileReaderDemo {
    public static void main(String[] args) throws IOException {
        FileReader fileReader = new FileReader("data/output/abc.txt");
        BufferedReader bReader = new BufferedReader(fileReader);
        BufferedWriter bWriter = new BufferedWriter(new FileWriter("data/output/cba.txt"));

        //char[] bts = new char[4];
        //int len = 0;
        String str = null;
        while ((str = bReader.readLine())!=null) {
            System.out.println(str);
//            System.out.println(bReader.readLine());
            bWriter.write(str);
            bWriter.newLine();
        }
        bWriter.flush();
    }
}
